package com.disease.chronic.Controller;

import com.disease.chronic.Global.Result;
import com.disease.chronic.Service.IndicatorDetailService;
import com.disease.chronic.dto.IndicatorDetailRequestDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.IOException;

@Controller
@RequestMapping("/indicator/detail")
public class IndicatorDetailController {

    @Autowired
    IndicatorDetailService indicatorDetailService;

    @PostMapping("/add")
    public @ResponseBody Result addIndicatorDetail(@RequestBody IndicatorDetailRequestDto indicatorDetailRequestDto) throws IOException {
        System.out.println(indicatorDetailRequestDto.toString());
        return  indicatorDetailService.insertIndicatorDetail(indicatorDetailRequestDto);

    }

}
